﻿using OSDA.ViewModels;

namespace OSDA.Models
{
    internal class SendModel : MainWindowBase
    {
        /// <summary>
        /// 发送区Header中的发送计数
        /// </summary>
        private int _SendDataCount;
        public int SendDataCount
        {
            get => _SendDataCount;
            set => SetProperty(ref _SendDataCount, value, nameof(SendDataCount));
        }

        private string _SendData;
        public string SendData
        {
            get => _SendData;
            set => SetProperty(ref _SendData, value);
        }

        private string _AutoSendNum;
        public string AutoSendNum
        {
            get => _AutoSendNum;
            set => SetProperty(ref _AutoSendNum, value);
        }

        #region 菜单栏 - 选项 - 发送换行
        private bool _NonesEnable;
        public bool NonesEnable
        {
            get => _NonesEnable;
            set => SetProperty(ref _NonesEnable, value);
        }

        private bool _CrEnable;
        public bool CrEnable
        {
            get => _CrEnable;
            set => SetProperty(ref _CrEnable, value);
        }

        private bool _LfEnable;
        public bool LfEnable
        {
            get => _LfEnable;
            set => SetProperty(ref _LfEnable, value);
        }

        private bool _CrLfEnable;
        public bool CrLfEnable
        {
            get => _CrLfEnable;
            set => SetProperty(ref _CrLfEnable, value);
        }
        #endregion

        public void SendDataContext()
        {
            SendData = string.Empty;
            SendDataCount = 0;

            AutoSendNum = "1000";

            /* 发送换行 */
            NonesEnable = true;
            CrEnable = false;
            LfEnable = false;
            CrLfEnable = false;
        }
    }
}
